package eclipse.weibo.service;

import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;

public class MyObservable extends Observable {
    private ArrayList<Observer> list = new ArrayList<Observer>();

    public synchronized void addObserver(Observer o) {
        this.list.add(o);
    }

    public void notifyObservers(Object arg) {
        for (Observer o : this.list) {
            o.update(this, arg);
        }
    }
}
